import { kgjHttp as http } from '@/services/http';
import type { ListResult, Limit } from '@/types/api/common';
const m = '/api/invest/claim';
// 认领池

interface IUpdateSelfRatio {
  /** * 商品id */
  product_id: number;
  /** * 自定义服务费率 */
  self_service_ratio: number;
}

interface IUpdateRemark {
  /** * 商品id */
  product_id: number;
  /** * 服务费率 */
  remark: string;
}

/** 认领池-自定义服务费修改 */
export const updateSelfRatio = (data: IUpdateSelfRatio) => http<ListResult<any>>({ method: 'post', url: `${m}/self/ratio/update`, data });

/** 认领池-备注修改 */
export const updateRemark = (data: IUpdateRemark) => http<ListResult<any>>({ method: 'post', url: `${m}/remark/update`, data });

/** 认领池列表 */
export const getList = (payload: { data: any; params: Limit }) => http<ListResult<any>>({ method: 'post', url: `${m}/list`, ...payload });

/** 认领池-取消认领 */
export const cancelClaim = (params: { product_id: number }) => http<ListResult<any>>({ method: 'post', url: `${m}/claim/cancel`, params });

/** 认领池-工作人员列表 */
export const getUserList = () => http<ListResult<any>>({ url: `${m}/user/list` });

/** 认领池-百应活动信息 */
export const getActivityConfig = () => http<ListResult<any>>({ url: `${m}/activity/config` });
